window.addEventListener('DOMContentLoaded', function() {
    var box = this.document.querySelector('.box');
    var start = [];
    var move = [];
    var pre = [];
    box.addEventListener('touchstart', function(e) {
        start[0] = e.touches[0].pageX;
        start[1] = e.touches[0].pageY;
        pre[0] = this.offsetLeft;
        pre[1] = this.offsetTop;
    })
    box.addEventListener('touchmove', function(e) {
        move[0] = e.touches[0].pageX - start[0];
        move[1] = e.touches[0].pageY - start[1];
        box.style.left = move[0] + pre[0] + 'px';
        box.style.top = move[1] + pre[1] + 'px';
    })
    // box.addEventListener('touchend', function() {
    //     console.log('end');
    // })
})